<!-- 表格内容,此组件还用于生成导出文件,所以不应该依赖vue组件相关的上下文 -->
<script lang="ts" setup>
import {
	EQP_CHECK_STATUS_OPTIONS,
	EQP_CHECK_TYPE_OPTIONS,
	getEnumOptionsField,
} from "@/config/enum-options";
defineOptions({ name: "SheetItem" });

function getStatusColor(status: string) {
	if (status === "预警") {
		return "#E70000";
	} else {
		return "#1D2129";
	}
}
</script>

<template>
	<el-table-column label="序号" type="index" width="60" fixed="left" />
	<el-table-column v-slot="{ row }" label="类别" prop="type">
		{{ getEnumOptionsField(EQP_CHECK_TYPE_OPTIONS, "label", row.type) }}
	</el-table-column>
	<el-table-column v-slot="{ row }" label="检修期限" prop="checkTimeEnd">
		{{ `${row.checkTimeStart}--${row.checkTimeEnd}` }}
	</el-table-column>
	<!-- <el-table-column label="地点" prop="checkAddress" /> -->
	<el-table-column label="方案" prop="checkPlan" />
	<el-table-column v-slot="{ row }" label="状态" prop="status">
		<span :style="{ color: getStatusColor(row.status) }">
			{{ getEnumOptionsField(EQP_CHECK_STATUS_OPTIONS, "label", row.status) }}
		</span>
	</el-table-column>
</template>
